//    Copyright (C) 2010 by Dolphin Technogy
//    All rights reserved.
// 
//    Copyright Notification
//    No part may be reproduced except as authorized by written permission
// 
//    @file   dti_asym_outbuf.v
//    @par    Company:
//              Dolphin Technology
//    @par    Project:
//              [projectname]
//    @par    Author:
//              N. Huy Bui
//    @par    Date:
//              July 17, 2012
//    @brieft
//              [a brieft description of the module]
//$Id$

module dti_asym (pop_clk, pop_rst_n, pop_req_n, fifo_empty, data_in, data_out, pop_wd_n, part_wd, pop_error);

parameter 	  IN_WIDTH    = 24;
parameter 	  OUT_WIDTH   = 8;
parameter 	  BYTE_ORDER  = 1;
parameter 	  ERR_MODE    = 1;

input 		  pop_clk;
input 		  pop_rst_n;
input 		  pop_req_n;
input 		  fifo_empty;
input 	  [IN_WIDTH-1:0] data_in;
output wire [OUT_WIDTH-1:0] data_out;
output wire 	  pop_wd_n;
output wire 	  part_wd;
output wire 	  pop_error;
wire 	  [1:0]   count_out_tmp;

//assign 		  pop_wd_n    = (count_out_tmp == 2) ? 1 : 0;

dti_counter #(IN_WIDTH, OUT_WIDTH, BYTE_ORDER)
  dti_counter_inst (pop_clk, pop_rst_n, pop_req_n, fifo_empty, count_out_tmp);

dti_mux #(IN_WIDTH, OUT_WIDTH)
  dti_mux_inst (data_in, count_out_tmp, data_out);

fsm #(ERR_MODE)
  fsm_inst (pop_clk, pop_rst_n, pop_req_n, fifo_empty, pop_wd_n, part_wd, pop_error);

endmodule // dti_asym_outbuf
